import request from '@/utils/request'

// 登录
export function login(data) {
    return request({
        url: '/users/login',
        method: 'post',
        data
    })
}

// 注册
export function register(data) {
    return request({
        url: '/users/register',
        method: 'post',
        data
    })
}

// 获取当前用户信息
export function getUserInfo() {
    return request({
        url: '/users/current',
        method: 'get'
    })
}

// 修改密码
export function changePassword(id, data) {
    return request({
        url: `/users/${id}/password`,
        method: 'post',
        data
    })
}

export function updateProfile(data) {
    return request({
        url: '/users/profile',
        method: 'put',
        data
    })
} 